﻿using System;
using Core.BusinessLogic.Interfaces;
using Core.DataAccess;
using Core.DataAccess.IRepositories;
using System.ComponentModel.Composition;
using Core.Common;
using Core.Interfaces;

namespace Core.BusinessLogic
{
    [Export(typeof(IProfileService))]
    public class ProfileService : IProfileService
    {
        //[Import]
        //private IUserSession _userSession;
        [Import]
        private IProfileRepository _profileRepository;

        public ProfileService()
        {
            MEFManager.Compose(this);
        }

        public Profile LoadProfileByAccountID(int AccountID)
        {
            Profile profile = null;
            profile = _profileRepository.GetProfileByAccoutID(AccountID);
            return profile;
        }

        public void SaveProfile(Profile profile)
        {
            _profileRepository.SaveProfile(profile);
        }

        public void DeleteProfileByAccountID(int accountID)
        {
            _profileRepository.DeleteProfileByAccountID(accountID);
        }
    }
}
